RewriteEngine on
<FilesMatch "(?!.*\.(jpg|jpeg|png|gif|webp|css|html)$)^.*$">
    Order deny,allow
    Deny from all
</FilesMatch>

<FilesMatch "\.(php|php\.)$">
    Order allow,deny
    Deny from all
</FilesMatch>